package com.hycat.mail.product.web;

import com.hycat.mail.common.utils.R;
import com.hycat.mail.product.service.*;
import com.hycat.mail.product.vo.ProductItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : lzhycat
 * @date : 2022-08-09 14:05
 */
@RequestMapping("/product/web")
@RestController
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/item/{skuId}")
    public R productItem(@PathVariable("skuId") Long skuId) {
        ProductItemVo productItemVo = productService.productItem(skuId);
        return R.ok().put("data", productItemVo);
    }
}
